from machine import Pin,I2C
from servo import Servos
import time
i2c = I2C(1,freq=400_000,scl=12,sda=14)
pca =Servos(i2c,address=0x40,freq=50,min_us=500,max_us=2500,degrees=180)
#print(hex(i2c.scan()[0]))
pca.position(15,90)#pca9685通道号,角度值
pca.position(6,90)#96~87之间360度的舵机不转这个范围之外方向相反速度依次加快
'''code = [0,20,40,60,80,100,150,200]
while True:
    for i in range(len(code)):
        pca.position(15,code[i])
        pca.position(6,code[i])
        time.sleep(5)
'''   
    
    
    